package com.yingxin.yx.framework.jwt.exception;

import com.yingxin.yx.framework.commons.GlobalCode;
import com.yingxin.yx.framework.commons.GlobalInstance;
import com.yingxin.yx.framework.commons.StatusCode;
import com.yingxin.yx.framework.commons.exception.BizException;
import lombok.Data;

/**
 * @author fanchao
 */

@Data
public class TokenExpireException extends BizException {


    private static final long serialVersionUID = -976926170430257201L;

    /**
     * 错误码
     */
    private String code;
    /**
     * 错误消息
     */
    private String message;

    public TokenExpireException() {
        StatusCode statusCode = GlobalInstance.getInstance().getStatusCodeMap().get(GlobalCode.TOKEN_EXPIRE);
        this.code = GlobalCode.TOKEN_EXPIRE;
        this.message = statusCode.getMessage();
    }

    @Override
    public String getMessage() {
        return message;
    }

}
